﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace TestOverrideHttpHandler
{
    public partial class RegisteredModules : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            Response.Write(ShowModules());
        }

        private string ShowModules()
        {
            HttpApplication application = Context.ApplicationInstance;
            HttpModuleCollection collection = application.Modules;

            string[] moduleNames = collection.AllKeys;

            StringBuilder sb = new StringBuilder();
            foreach(string name in moduleNames)
            {
                sb.Append("<b style='color:#00f'>名称:" + name + "</b><br />");
                sb.Append("类型：" + collection[name].ToString() + "<br />");
            }
            return sb.ToString();
        }
    }
}